package fields;

import java.awt.geom.Point2D;

public class Util {
    static int MAX_DRAW_COUNT = 2500;
    static int DELAY = 62;//40->25, 62->16
    static double SPEED_ORDER = 4.8;
    static double CHARGE_ORDER = 1e-2;
    static int CHARGE_LINE_COUNT = 16;
    static double CHARGE_LINE_START_RADIUS = 5;
    static int PREF_WIDTH = 647;//647;
    static int PREF_HEIGHT = 200;//400;
    static int SPEED_VARIETY = 30;
    static int CHARGE_VARIETY = 12;
    static int MAX_DRAW_SECTION_SQ_LENGTH = Integer.MAX_VALUE;//20 * 20;
    static boolean USE_ALPHA = true;

    private Util() {
    }

    public static double norm(double[] f) {
        double n = Math.sqrt(f[0] * f[0] + f[1] * f[1]);
        f[0] /= n;
        f[1] /= n;
        return n;
    }

    public static void norm(Point2D point) {
        double n = Math.sqrt(point.getX() * point.getX() + point.getY() * point.getY());
        point.setLocation(point.getX() / n, point.getY() / n);
    }
}
